#define DEBUG
#include <cstdio>

using namespace std;

const int maxn=300;

class Set {
public:
  int fa[maxn+1];

  void init(int n) {
    for (int i=1; i<=n; i++) {
      fa[i] = i;
    }
  }

  int getFa(int o) {
    return fa[o] = (fa[o]==o ? o : getFa(fa[o]));
  }

  void merge(int a, int b) {
    a=getFa(a), b=getFa(b);
    if (a!=b) {
      fa[a] = b;
    }
  }
};

long double sqr(long double a) {
  return a*a;
}

long double sqrdis(long double x1, long double y1, long double x2, long double y2) {
  return sqr(x2-x1)+sqr(y2-y1);
}

bool intersect(long double x1, long double y1, long double x2, long double y2, long double r1, long double r2) {
  return sqrdis(x1, y1, x2, y2)<sqr(r1+r2);
}

long double calcXPoint(long double x1, long double y1, long double x2, long double y2) {
  if (x1==x2) {
    return x1;
  }
  long double k=(y1-y2)/(x1-x2), b=y1-x1*k;
  return -b/k;
}

int main() {
#ifdef DEBUG
  freopen("src.in", "r", stdin);
  freopen("src.out", "w", stdout);
#endif

  static long double x[maxn+1], y[maxn+1], r[maxn+1];
  int n;
  for (; scanf("%d", &n)!=EOF; ) {
    for (int i=1; i<=n; i++) {
      scanf("%LF %LF %LF", x+i, y+i, r+i);
    }
    scanf("%LF %LF %LF", x, y, r);
    for (int i=1; i<=n; i++) {
      x[i] -= x[0], y[i] -= y[0], r[i] += r[0];
    }

    static Set set;
    set.init(n);
    for (int i=1; i<=n; i++) {
      for (int j=i+1; j<=n; j++) {
	if (intersect(x[i], y[i], x[j], y[j], r[i], r[j])) {
	  if (((y[i]*y[j]>0 || (y[i]*y[j]==0 && y[i]+y[j]>=0)))) {
	    set.merge(i, j);
	  } else if ((y[i]*y[j]<=0 && calcXPoint(x[i], y[i], x[j], y[j])>=0)) {
	    set.merge(i, j);
	  }
	}
      }
    }

    bool flag=true;
    for (int i=1; i<=n && flag; i++) {
      for (int j=i+1; j<=n && flag; j++) {
	if (intersect(x[i], y[i], x[j], y[j], r[i], r[j])) {
	  if (((y[i]*y[j]<0 || (y[i]*y[j]==0 && y[i]+y[j]<0)) && calcXPoint(x[i], y[i], x[j], y[j])<=0)) {
	    if (set.getFa(i)==set.getFa(j)) {
	      flag = false;
	    }
	  }
	}
      }
    }
    printf(flag ? "YES\n" : "NO\n");
  }

  fclose(stdin);
  fclose(stdout);
  return 0;
}
